package org.ycy.data.generator.utils;

import cn.hutool.core.util.RandomUtil;

import java.util.concurrent.ThreadLocalRandom;

/**
 * @ClassName ChineseUtil
 * @Description TODO
 * @Author 原长友
 * @Date 2023/5/22 23:14
 * @Version 1.0
 **/
public class ChineseUtil {

    public static String getRandomChinese(int length) {
        ThreadLocalRandom random = RandomUtil.getRandom();
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < length; i++) {
            stringBuilder.append((char) (random.nextInt(20902) + 19968));
        }
        return stringBuilder.toString();
    }

    public static void main(String[] args) {
        System.out.println(getRandomChinese(10));
    }
}
